Sharing compiled code for executing queries across query engines

ABSTRACT

Compiled portions of code generated to perform a query plan at a query engine may be shared with other query engines. A data store, separate from the query engines, may store compiled portions of query code generated for different queries. If a query engine does not have a locally stored compiled portion of query code, then the separate data store may be accessed in order to obtain a compiled portion of query code, allowing reuse of compiled query code across different queries engines for queries directed to different databases.

This application is a continuation of U.S. patent application Ser. No.16/370,614, filed Mar. 29, 2019, which is hereby incorporated byreference herein in its entirety.

BACKGROUND

As the technological capacity for organizations to create, track, andretain information continues to grow, a variety of differenttechnologies for managing and storing the rising tide of informationhave been developed. Different storage systems, database systems, andother data processing platforms may use code generation at run-time inorder to optimize the execution of queries, as the instruction footprintbecomes smaller with much fewer branches and function calls. Techniquesto improve the performance of code generation and execution at run-timemay provide further performance improvements to queries in such systems.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a logical block diagram of sharing compiled code toexecute queries across query engines, according to some embodiments.

FIG. 2 is a logical block diagram illustrating a provider networkoffering data processing services that implement sharing compiled codeto execute queries across query engines, according to some embodiments.

FIG. 3 is a logical block diagram illustrating an example processingcluster of a data processing service that may implement sharing compiledcode to execute queries across query engines, according to someembodiments.

FIG. 4 is as logical block diagram illustrating a leader node thatobtains shared execution code for performing queries, according to someembodiments.

FIG. 5 is a logical block diagram illustrating a query execution codecompilation service, according to some embodiments.

FIG. 6 is a logical block diagram illustrating warming events for aglobal compiled code store, according to some embodiments.

FIG. 7 is a high-level flowchart illustrating methods and techniques toimplement sharing compiled code to execute queries across query engines,according to some embodiments.

FIG. 8 is a high-level flowchart illustrating methods and techniques toidentify the presence of compiled segments of code in a store forcompiled segments of code, according to some embodiments.

FIG. 9 is a high-level flowchart illustrating methods and techniques towarm a store for compiled code for executing queries, according to someembodiments.

FIG. 10 illustrates an example system that implements the variousmethods, techniques, and systems described herein, according to someembodiments.

While embodiments are described herein by way of example for severalembodiments and illustrative drawings, those skilled in the art willrecognize that embodiments are not limited to the embodiments ordrawings described. It should be understood, that the drawings anddetailed description thereto are not intended to limit embodiments tothe particular form disclosed, but on the contrary, the intention is tocover all modifications, equivalents and alternatives falling within thespirit and scope as defined by the appended claims. The headings usedherein are for organizational purposes only and are not meant to be usedto limit the scope of the description or the claims. As used throughoutthis application, the word “may” is used in a permissive sense (i.e.,meaning having the potential to), rather than the mandatory sense (i.e.,meaning must). Similarly, the words “include,” “including,” and“includes” mean including, but not limited to.

It will also be understood that, although the terms first, second, etc.may be used herein to describe various elements, these elements shouldnot be limited by these terms. These terms are only used to distinguishone element from another. For example, a first contact could be termed asecond contact, and, similarly, a second contact could be termed a firstcontact, without departing from the scope of the present invention. Thefirst contact and the second contact are both contacts, but they are notthe same contact.

DETAILED DESCRIPTION OF EMBODIMENTS

Various embodiments of sharing compiled code to execute queries acrossquery engines are described herein. As noted earlier, data processingsystems may use code generation at run-time in order to increase theperformance of queries. Generating code to perform queries, however, mayinvolve compiling the code to perform the query as part of the queryperformance process at a query engine. For example, a query engine maygenerate the code and then compiles the code invoking a compiler process(e.g., Gnu Compiler Collection (gcc)). In some scenarios, thecompilation time may actually be higher than the run-time of the query(once compilation is complete).

Sharing compiled code to execute queries across query engines may takeadvantage of the substantial amount of re-use available for generatedcode to perform queries. For example, similar-looking query plans mayend up generating the same fragment or segment of code. Storingpreviously generated code for fragments, segments, or other portions ofcode to perform a query can reduce compilation time, and thus reducequery performance time. Sharing compiled code may further reducecompilation time, even in scenarios where query engine has not seen many(or any queries), creating a “cold start” scenario for the store (e.g.,cache) of generated code. For example, sharing compiled code may utilizea code pool, such as a global compiled code store, that it is visibleand shareable across a collection of query engines and databases. Thus,even if a query to one query engine that handles requests to onedatabase includes a portion of code compiled in a different queryreceived at a different query engine for a different database, somereuse of the compiled code can be achieved reducing the performancecosts of the later and unrelated query. Sharing compiled code forexecution across query engines may allow many (or all) unique codeportions to be executed only once per group of query engines that accessthe global compiled code store. Moreover, in order to minimize theremaining “cold start” effect for new query engines, the global compiledcode store may be evaluated and used to “warm” or pre-populate a localcache for a query engine with compiled code the query engine is likelyto receive (but has not yet received), as discussed below with regard toFIGS. 6 and 9 .

FIG. 1 illustrates a logical block diagram of sharing compiled code toexecute queries across query engines, according to some embodiments.Query engines 110 and 120 may be implemented as part of respective dataprocessing engines, systems or platforms (e.g., a database processingplatform, a map-reduce platform, etc.). As illustrated in scene 102,when a database query is received at query engine 110, such as query152, query engine 110 may determine a query plan to execute the query,in some embodiments. From the query plan code may be generated toexecute the plan, as discussed below with regard to FIGS. 4 and 7 .Query engine 110 may implement a local store 112, which may storecompiled code object(s) 114. For portions of code that have compiledobjects stored in local store 112, query engine 110 may perform thecompiled portions without performing a compilation of the correspondingportions of code (but may instead input or update new parameters wheninvoking execution of the compiled code objects). However, for querywhere the compiled code is not present, a check in global store 130,which may be separately hosted from query engines 110 and 120 todetermine if the code object is present. If not, then query engine 110may compile the code object in order to perform the query and updatecompiled code objects 116. As discussed below with regard to FIG. 4 ,query engine 110 may directly update global store with compiled codeobject 154 and/or store the code for another system, such as queryexecution code compilation service 250 to generate and update 154 globalstore 130.

Although query engine 110 had to compile the portion of code, thecompilation cost may be used to generate cost savings for that queryengine 110, and other query engines like query engine 120. For example,as illustrated in scene 104, query engine 120 may receive query 162.Query 162 may have a portion of generated code not found among compiledcode objects 124 in local store 122. Instead, query engine 120 may getthe compiled code object 164 from updated code object(s) 134, as queryengine 110 had already seen and compiled the code object for that samecode (even if query 162 is a different query directed to a differentdatabase).

Please note that the previous description of sharing compiled code toexecute queries across query engines is a logical illustration and thusis not to be construed as limiting as to the implementation of a queryengine, local store or global store.

This specification begins with a general description of a providernetwork that implements multiple different services, including dataprocessing services and storage services, which may perform sharingcompiled code to execute queries across query engines. Then variousexamples of multiple data processors, such as a data warehouse service,including different components/modules, or arrangements ofcomponents/module that may be employed as part of implementing the dataprocessors are discussed. A number of different methods and techniquesto implement sharing compiled code to execute queries across queryengines are then discussed, some of which are illustrated inaccompanying flowcharts. Finally, a description of an example computingsystem upon which the various components, modules, systems, devices,and/or nodes may be implemented is provided. Various examples areprovided throughout the specification.

FIG. 2 is a logical block diagram illustrating a provider networkoffering data processing services that implement sharing compiled codeto execute queries across query engines, according to some embodiments.Provider network 200 may be a private or closed system or may be set upby an entity such as a company or a public sector organization toprovide one or more services (such as various types of cloud-basedstorage) accessible via the Internet and/or other networks to clients280. Provider network 200 may be implemented in a single location or mayinclude numerous data centers hosting various resource pools, such ascollections of physical and/or virtualized computer servers, storagedevices, networking equipment and the like (e.g., computing system 1000described below with regard to FIG. 10 ), needed to implement anddistribute the infrastructure and storage services offered by theprovider network 200. In some embodiments, provider network 200 mayimplement various computing resources or services, such as dataprocessing service(s) 220, (e.g., a map reduce service, a data warehouseservice, and other large scale data processing services or databaseservices), format independent data processing service 220, and datastorage services 270 (e.g., object storage services or block-basedstorage services that may implement a centralized data store for varioustypes of data), and/or any other type of network based services (whichmay include a virtual compute service and various other types ofstorage, processing, analysis, communication, event handling,visualization, and security services not illustrated).

In various embodiments, the components illustrated in FIG. 2 may beimplemented directly within computer hardware, as instructions directlyor indirectly executable by computer hardware (e.g., a microprocessor orcomputer system), or using a combination of these techniques. Forexample, the components of FIG. 2 may be implemented by a system thatincludes a number of computing nodes (or simply, nodes), each of whichmay be similar to the computer system embodiment illustrated in FIG. 10and described below. In various embodiments, the functionality of agiven system or service component (e.g., a component of data processingservice 220, or data storage service 270) may be implemented by aparticular node or may be distributed across several nodes. In someembodiments, a given node may implement the functionality of more thanone service system component (e.g., more than one data store component).

Data processing services 220 may be various types of data processingservices that perform general or specialized data processing functions(e.g., anomaly detection, machine learning, data mining, big dataquerying, or any other type of data processing operation). For example,in at least some embodiments, data processing services 220 may include amap reduce service that creates clusters of processing nodes thatimplement map reduce functionality over data stored in the map reducecluster as well as data stored in one of data storage services 270. Inanother example, data processing service(s) 220 may include varioustypes of database services (both relational and non-relational) forstoring, querying, and updating data. Such services may beenterprise-class database systems that are highly scalable andextensible. Queries may be directed to a database in data processingservice(s) 220 that is distributed across multiple physical resources,and the database system may be scaled up or down on an as needed basis.The database system may work effectively with database schemas ofvarious types and/or organizations, in different embodiments. In someembodiments, clients/subscribers may submit queries in a number of ways,e.g., interactively via an SQL interface to the database system. Inother embodiments, external applications and programs may submit queriesusing Open Database Connectivity (ODBC) and/or Java DatabaseConnectivity (JDBC) driver interfaces to the database system. Forinstance, data processing service(s) 220 may implement, in someembodiments, a data warehouse service.

Data storage service(s) 270 may implement different types of data storesfor storing, accessing, and managing data on behalf of clients 280 as anetwork-based service that enables clients 280 to operate a data storagesystem in a cloud or network computing environment. Data storageservice(s) 270 may also include various kinds of object or file datastores for putting, updating, and getting data objects or files. Forexample, one data storage service 270 may be an object-based data storethat allows for different data objects of different formats or types ofdata, such as structured data (e.g., database data stored in differentdatabase schemas), unstructured data (e.g., different types of documentsor media content), or semi-structured data (e.g., different log files,human-readable data in different formats like JavaScript Object Notation(JSON) or Extensible Markup Language (XML)) to be stored and managedaccording to a key value or other unique identifier that identifies theobject. In at least some embodiments, data storage service(s) 270 may betreated as a data lake. For example, an organization may generate manydifferent kinds of data, stored in one or multiple collections of dataobjects in a data storage service 270. The data objects in thecollection may include related or homogenous data objects, such asdatabase partitions of sales data, as well as unrelated or heterogeneousdata objects, such as audio files and web site log files. Data storageservice(s) 270 may be accessed via programmatic interfaces (e.g., APIs)or graphical user interfaces. For example, format independent dataprocessing service 220 may access data objects stored in data storageservices via the programmatic interfaces.

Generally speaking, clients 280 may encompass any type of client thatcan submit network-based requests to provider network 200 via network260, including requests for storage services (e.g., a request to query adata processing service 220, or a request to create, read, write,obtain, or modify data in data storage service(s) 270, etc.). Forexample, a given client 280 may include a suitable version of a webbrowser, or may include a plug-in module or other type of code modulethat can execute as an extension to or within an execution environmentprovided by a web browser. Alternatively, a client 280 may encompass anapplication such as a database application (or user interface thereof),a media application, an office application or any other application thatmay make use of data processing service(s) 220, format independent dataprocessing service 220, or storage resources in data storage service(s)270 to store and/or access the data to implement various applications.In some embodiments, such an application may include sufficient protocolsupport (e.g., for a suitable version of Hypertext Transfer Protocol(HTTP)) for generating and processing network-based services requestswithout necessarily implementing full browser support for all types ofnetwork-based data. That is, client 280 may be an application that caninteract directly with provider network 200. In some embodiments, client280 may generate network-based services requests according to aRepresentational State Transfer (REST)-style network-based servicesarchitecture, a document- or message-based network-based servicesarchitecture, or another suitable network-based services architecture.

In some embodiments, a client 280 may provide access to provider network200 to other applications in a manner that is transparent to thoseapplications. For example, client 280 may integrate with an operatingsystem or file system to provide storage on one of data storageservice(s) 270 (e.g., a block-based storage service). However, theoperating system or file system may present a different storageinterface to applications, such as a conventional file system hierarchyof files, directories and/or folders. In such an embodiment,applications may not need to be modified to make use of the storagesystem service model. Instead, the details of interfacing to the datastorage service(s) 270 may be coordinated by client 280 and theoperating system or file system on behalf of applications executingwithin the operating system environment. Similarly, a client 280 may bean analytics application that relies upon data processing service(s) 220to execute various queries for data already ingested or stored in thedata processing service (e.g., such as data maintained in a datawarehouse service, like data warehouse service) or data stored in a datalake hosted in data storage service(s) 270.

Clients 280 may convey network-based services requests (e.g., accessrequests to read or write data may be directed to data in data storageservice(s) 270, or operations, tasks, or jobs, being performed as partof data processing service(s) 220) to and receive responses fromprovider network 200 via network 260. In various embodiments, network260 may encompass any suitable combination of networking hardware andprotocols necessary to establish network-based-based communicationsbetween clients 280 and provider network 200. For example, network 260may generally encompass the various telecommunications networks andservice providers that collectively implement the Internet. Network 260may also include private networks such as local area networks (LANs) orwide area networks (WANs) as well as public or private wirelessnetworks. For example, both a given client 280 and provider network 200may be respectively provisioned within enterprises having their owninternal networks. In such an embodiment, network 260 may include thehardware (e.g., modems, routers, switches, load balancers, proxyservers, etc.) and software (e.g., protocol stacks, accounting software,firewall/security software, etc.) necessary to establish a networkinglink between given client 280 and the Internet as well as between theInternet and provider network 200. It is noted that in some embodiments,clients 280 may communicate with provider network 200 using a privatenetwork rather than the public Internet. In some embodiments, clients ofdata processing services 220, format independent data processing service220, and/or data storage service(s) 270 may be implemented withinprovider network 200 (e.g., an application hosted on a virtual computingresource that utilizes a data processing service 220) to implementvarious application features or functions and thus various features ofclient(s) 280 discussed above may be applicable to such internal clientsas well.

In at least some embodiments, one of data processing service(s) 220 maybe a data warehouse service. A data warehouse service may offer clientsa variety of different data management services, according to theirvarious needs. In some cases, clients may wish to store and maintainlarge of amounts data, such as sales records marketing, managementreporting, business process management, budget forecasting, financialreporting, website analytics, or many other types or kinds of data. Aclient's use for the data may also affect the configuration of the datamanagement system used to store the data. For instance, for certaintypes of data analysis and other operations, such as those thataggregate large sets of data from small numbers of columns within eachrow, a columnar database table may provide more efficient performance.In other words, column information from database tables may be storedinto data blocks on disk, rather than storing entire rows of columns ineach data block (as in traditional database schemes). The followingdiscussion describes various embodiments of a relational columnardatabase system. However, various versions of the components discussedbelow as may be equally adapted to implement embodiments for variousother types of relational database systems, such as row-orienteddatabase systems. Therefore, the following examples are not intended tobe limiting as to various other types or formats of relational databasesystems.

In some embodiments, storing table data in such a columnar fashion mayreduce the overall disk I/O requirements for various queries and mayimprove analytic query performance. For example, storing database tableinformation in a columnar fashion may reduce the number of disk I/Orequests performed when retrieving data into memory to perform databaseoperations as part of processing a query (e.g., when retrieving all ofthe column field values for all of the rows in a table) and may reducethe amount of data that needs to be loaded from disk when processing aquery. Conversely, for a given number of disk requests, more columnfield values for rows may be retrieved than is necessary when processinga query if each data block stored entire table rows. In someembodiments, the disk requirements may be further reduced usingcompression methods that are matched to the columnar storage data type.For example, since each block contains uniform data (i.e., column fieldvalues that are all of the same data type), disk storage and retrievalrequirements may be further reduced by applying a compression methodthat is best suited to the particular column data type. In someembodiments, the savings in space for storing data blocks containingonly field values of a single column on disk may translate into savingsin space when retrieving and then storing that data in system memory(e.g., when analyzing or otherwise processing the retrieved data).

A data warehouse service may be implemented by a large collection ofcomputing devices, such as customized or off-the-shelf computingsystems, servers, or any other combination of computing systems ordevices, such as the various types of systems 1000 described below withregard to FIG. 10 . For example, different subsets of these computingdevices may be controlled by control plane 230. Control plane 230, forexample, may provide a cluster control interface to clients or users whowish to interact with the processing clusters 240 managed by controlplane 230. For example, control plane 230 may generate one or moregraphical user interfaces (GUIs) for storage clients, which may then beutilized to select various control functions offered by the controlinterface for the processing clusters 240 hosted in the data warehouseservice. Control plane 230 may provide or implement access to variousmetrics collected for the performance of different features of datawarehouse service, including processing cluster 240 performance, in someembodiments.

As discussed above, various clients (or customers, organizations,entities, or users) may wish to store and manage data using a datamanagement service. Processing clusters may respond to various requests,including write/update/store requests (e.g., to write data into storage)or queries for data (e.g., such as a Server Query Language request (SQL)for particular data), along with many other data management or storageservices. Multiple users or clients may access a processing cluster toobtain data warehouse services. In at least some embodiments, a datawarehouse service may provide network endpoints to the clusters whichallow the clients to send requests and other messages directly to aparticular cluster. Network endpoints, for example may be a particularnetwork address, such as a URL, which points to a particular cluster.For instance, a client may be given the network endpoint“http://mycluster.com” to send various request messages to. Multipleclients (or users of a particular client) may be given a networkendpoint for a particular cluster. Various security features may beimplemented to prevent unauthorized users from accessing the clusters.Conversely, a client may be given network endpoints for multipleclusters.

Processing clusters, such as processing clusters 240 a, 240 b, through240 n, hosted by the data warehouse service may provide anenterprise-class database query and management system that allows usersto send data processing requests to be executed by the clusters 240,such as by sending a query to a cluster control interface implemented bythe network-based service. Processing clusters 240 may perform dataprocessing operations with respect to data stored locally in aprocessing cluster, as well as remotely stored data. For example, anobject-based storage service may be a data storage service 270implemented by provider network 200 that stores remote data. Queriessent to a processing cluster 240 may be directed to local data stored inthe processing cluster 240. Therefore, processing clusters may implementlocal data processing to plan and execute the performance of querieswith respect to local data in the processing cluster.

Operations performed by control plane 230 to scale processing clusters240 may allow users of the network-based service to perform their datawarehouse functions, such as fast querying capabilities over structureddata, integration with various data loading and ETL (extract, transform,and load) tools, client connections with best-in-class businessintelligence (BI) reporting, data mining, and analytics tools, andoptimizations for very fast execution of complex analytic queries suchas those including multi-table joins, sub-queries, and aggregation, moreefficiently.

Query execution code compilation service 250 and global compiled codestore 260 may, as discussed below allow for the sharing of executioncode across queries, as discussed in more detail below with regard toFIGS. 4-8 .

FIG. 3 is a logical block diagram illustrating an example processingcluster of a data processing service that may implement sharing compiledcode to execute queries across query engines, according to someembodiments. Processing cluster 300 may be a data warehouse cluster, orother data processing plat form like processing clusters 240 discussedabove with regard to FIG. 2 , or another processing cluster thatdistributes execution of a query among multiple processing nodes. Asillustrated in this example, a processing cluster 300 may include aleader node 310 and compute nodes 320 a, 320 b, and 320 n, which maycommunicate with each other over an interconnect (not illustrated).Leader node 310 may implement query planning to generate query plan(s)and instructions for executing queries on processing cluster 300 thatperform data processing, as discussed in detail below with regard toFIG. 4 . As described herein, each node in a processing cluster 300 mayinclude attached storage, such as attached storage 322 a, 322 b, and 322n, on which a database (or portions thereof) may be stored on behalf ofclients (e.g., users, client applications, and/or storage servicesubscribers).

Note that in at least some embodiments, query processing capability maybe separated from compute nodes, and thus in some embodiments,additional components may be implemented for processing queries.Additionally, it may be that in some embodiments, no one node inprocessing cluster 300 is a leader node as illustrated in FIG. 3 , butrather different nodes of the nodes in processing cluster 300 may act asa leader node or otherwise direct processing of queries to data storedin processing cluster 300. While nodes of processing cluster may beimplemented on separate systems or devices, in at least someembodiments, some or all of processing cluster may be implemented asseparate virtual nodes or instance on the same underlying hardwaresystem (e.g., on a same server).

In at least some embodiments, processing cluster 300 may be implementedas part of a data warehouse service, or another one of data processingservice(s) 220. Leader node 310 may manage communications with clients,such as clients 280 discussed above with regard to FIG. 2 . For example,leader node 310 may be a server that receives a query 302 from variousclient programs (e.g., applications) and/or subscribers (users), thenparses them and develops an execution plan (e.g., query plan(s)) tocarry out the associated database operation(s)). More specifically,leader node 310 may develop the series of steps necessary to obtainresults for the query. Query 302 may be directed to data that is storedboth locally within processing cluster 300 (e.g., at one or more ofcompute nodes 320) and data stored remotely (which may be accessible byanother data processing service and/or storage service (notillustrated)). Leader node 310 may also manage the communications amongcompute nodes 320 instructed to carry out database operations for datastored in the processing cluster 300. For example, node-specific queryinstructions 314 may be generated or compiled code that is distributedby leader node 310 to various ones of the compute nodes 320 to carry outthe steps needed to perform query 302, as discussed in detail below withregard to FIG. 4 . Leader node 310 may receive data and query responsesor results from compute nodes 320 in order to determine a final resultfor query 302. A database schema, data format and/or other metadatainformation for the data stored among the compute nodes, such as thedata tables stored in the cluster, may be managed and stored by leadernode 310.

Processing cluster 300 may also include compute nodes, such as computenodes 320 a, 320 b, and 320 n. Compute nodes 320, may for example, beimplemented on servers or other computing devices, such as thosedescribed below with regard to computer system 1000 in FIG. 10 , andeach may include individual query processing “slices” defined, forexample, for each core of a server's multi-core processor, one or morequery processing engine(s), such as query execution platform(s) 324 a,324 b, and 324 n, to execute the instructions 314 or otherwise performthe portions of the query plan assigned to the compute node. Queryexecution 324 may access a certain memory and disk space in order toprocess a portion of the workload for a query (or other databaseoperation) that is sent to one or more of the compute nodes 320. Queryexecution 324 may access attached storage, such as 322 a, 322 b, and 322n, to perform operation(s), such as operations 318 a, 318 b, and 318 n.For example, query engine 324 may scan data in attached storage 322,access indexes, perform joins, semi joins, aggregations, or any otherprocessing operation assigned to the compute node 320. Compute nodes 320may send intermediate results from queries back to leader node 310 forfinal result generation (e.g., combining, aggregating, modifying,joining, etc.).

Attached storage 322 may be implemented as one or more of any type ofstorage devices and/or storage system suitable for storing dataaccessible to the compute nodes, including, but not limited to:redundant array of inexpensive disks (RAID) devices, disk drives (e.g.,hard disk drives or solid state drives) or arrays of disk drives such asJust a Bunch Of Disks (JBOD), (used to refer to disks that are notimplemented according to RAID), optical storage devices, tape drives,RAM disks, Storage Area Network (SAN), Network Access Storage (NAS), orcombinations thereof. In various embodiments, disks may be formatted tostore database tables (e.g., in column oriented data formats or otherdata formats).

FIG. 4 is as logical block diagram illustrating a leader node thatobtains shared execution code for performing queries, according to someembodiments. Leader node 410, similar to leader node 310 discussed abovewith regard to FIG. 3 , may implement various features to handle a queryreceived from a client. For example, leader node 410 may implement queryparsing 420, which may take a received query 402, and check for queryvalidity (e.g., syntax errors), and generate a parse tree, symbol tree,or other output that can be used to generate a plan to perform a query.Leader node 410 may implement query planning 430 to evaluate thefeatures of the parsed query and generate a plan to perform the query.For example, query planning 430 may apply various rules to generate aninitial tree or graph of operations, logical and physical, to performthe query. Query planning 430 may then perform various rule-basedoptimizations to reduce the cost of performing the query, such asmodifying the order or type of join operations, selecting differenttypes of scans, filters, or other operations. In some embodiments, queryplanning 430 may implement cost-based optimization to select amongstmultiple different possible query plans to identify the plan with thelowest cost.

Leader node 410 may implement code generation 440, in variousembodiments. Code generation 440 may accept a query plan and identify(e.g., via a library or other mapping), the various functions,procedures, statements, classes, or other instructions to include in aprogram language to output as the execution code. In at least someembodiments, code generation may break down a query plan into a seriesof individual streams, segments and segment steps. In this way, eachstream may be processed sequentially so that the code for each segmentwithin a stream is generated and compiled to produce an object file toperform that portion of the query.

In at least some embodiments, leader node 410 may implement compiledcode storage management 450, which may identify whether to usepreviously compiled code portions or to compile the code at compiler 454for performing the query. Various techniques, such as those discussedbelow with regard to FIGS. 7 and 8 , may be implemented by compiled codestorage management 450, in some embodiments. For example, compiled codestorage management 450 may evaluate each code segment from codegeneration 440, and request 482 a compiled object for the code segmentfrom local compiled code storage 452. If local compiled code storage 452returns the compiled code object 484, then compiled code storagemanagement 450 may submit the compiled code object 498 to codeexecution.

If local compiled code storage 452 does not store the compiled objectfor the code segment, then compiled code storage management 450 mayattempt to request 486 the compiled code object from global compiledcode store 260. If global compiled code store 260 has the compiled codeobject, it may return the compiled object 488. Compiled code storagemanagement 450 may then submit 498 the compiled code object to codeexecution 460. If a compiled code object for the code segment cannot beobtained, however, then compiled code storage management 450 may submitthe code segment to compiler 454, which may compile the code segment andsubmit 498 the code segment to code execution 460. Compiler 454 may alsoprovide the compiled code object 492 back to code compiled storagemanagement 450, which may update 492 local compiled code storage 452 toinclude the compiled code object.

In some embodiments, compiled code storage management 450 may store thecompiled code object 494 direct to global compiled code store 260. Inother embodiments, as discussed below with regard to FIG. 5 , compiledcode storage management 450 may store the uncompiled code 496 to a datastore 470 which query execution code compilation service 250 may accessto compile.

Code execution 460 may then send execution instructions 404 to othernodes in a processing cluster to perform the compiled code. In someembodiments, leader node 410 may perform some or all of the compiledcode objects.

FIG. 5 is a logical block diagram illustrating a query execution codecompilation service, according to some embodiments. Query execution codecompilation service 250 may implement global compiled code storemanagement 510 in order to manage global compiled code store 260. Globalcompiled code storage management 510 may direct compilation worker(s)520 (e.g., compilers and other data access applications hosted onsystems, such as computing system 1000 discussed below in FIG. 10 ) inorder to access and update global compiled code store 260. Storageservice 530 may be an object store, file store, or other data storagesystem which may accept requests to store code segments 551 generated byquery engines, as discussed above with regard to FIG. 4 . These codesegments 532 may be stored as distinct items or objects in storageservice 530 so that the code segment(s) 532 may be individual compiledto create individual executable objects, in some embodiments.

Global compiled code storage management 510 may detect or otherwiseidentify uncompiled code segments 552. For example, storage service 530may send an update or other notification to global compiled code storagemanagement 510 when new code segments are stored, in some embodiments.In other embodiments, global compiled code store management 510 maysweep or poll storage service 530 for new code segment(s) 532. Globalcompiled code storage management 510 may submit a compilation job 554 tocompilation worker(s) 520 to obtain and compile code segment(s) 532.Compilation worker(s) 520 may obtain 556 the code segment(s) 532 fromthe storage service 530 and store the compiled code object(s) 558 inglobal code store 260. For example, the compiled code objects may bestored in a table 542 with individual items, objects, or entries oftable 542 corresponding to different compiled code objects 544. In someembodiments, compilation worker(s) 520 may encrypt and/or compress thecompiled code objects before storing 520. Because compilation worker(s)520 may compile code segments outside of the performance path of thequery that submitted the code segments, compilation worker(s) 520 mayperform computationally expensive but optimal compilation features toenhance code performance (e.g., in a processor, memory, network,storage, or other resource utilization), in some embodiments, which maybe different than the compilation features or settings used at aprocessing cluster to compile code generated in response to a queryreceived at the processing cluster.

FIG. 6 is a logical block diagram illustrating warming events for aglobal compiled code store, according to some embodiments. As discussedabove with regard to FIG. 5 , query execution code compilation service250 may implement global compiled code storage management 510, whichmay, in various embodiments, detect a warming event 641 (e.g., inresponse to an externally triggered event and request to warm a cache),such as an indication of an update to query engine application deployedacross the data processing service.

Global compiled code management 510 may issue a warming job 643 to one(or more compilation worker(s) 520), which may generate a warmed tableof compiled objects using various techniques, such as those discussedbelow with regard to FIG. 9 . For example, compilation worker(s) 520 maysend request(s) 645 to global compiled code store 260 to access existingtable 610, which may store compiled code objects 612. The identifiedcompiled code object(s) 645 may indicate those portions of code likelyto be used again in the new table. Thus compilation worker(s) 520 maysend requests 647 to obtain information to compile code segment(s) 647,corresponding to compiled code object(s) 612 (e.g., code segment(s) 620,query plans(s) 622 that cause the code segments to be generated, or thequer(ies) 624 that cause the code segments to be generated) from storageservice 530. Compilation worker(s) 520 may then compile the obtainedcode segments (e.g., using settings, libraries, features, or otherchanges that correspond to the detected warming event, such as a newquery engine version deployed) and then store the compiled codeobject(s) 649, in some embodiments. For example, code segment(s) 620 maycompiled without further processing, or query plan(s) 622 may be used togenerate the code segments which are then compiled, or quer(ies) 624 maybe used to generate query plans and then the code segments which arethen compiled). The compiled code object(s) 632 may be stored in newtable 630, which may, for instance, correspond to a new query engineapplication or other changes to compilation incurred by the warmingevent. In some embodiments, a time to live or other value may be set forstored compiled code objects so that the code objects may be deleted ormade inaccessible after a period of time.

Although FIGS. 2-6 have been described and illustrated in the context ofa provider network implementing different data processing services, likea data warehousing service, the various components illustrated anddescribed in FIGS. 2-6 may be easily applied to other data processingsystems that utilize multiple query engines to perform queries that mayperform common portions of query operations such that execution code maybe shared. As such, FIGS. 2-6 are not intended to be limiting as toother embodiments of sharing compiled code to execute queries acrossquery engines. FIG. 7 is a high-level flowchart illustrating methods andtechniques to implement sharing compiled code to execute queries acrossquery engines, according to some embodiments. Various different systemsand devices may implement the various methods and techniques describedbelow, either singly or working together.

A query may be a received at a query engine (e.g., a database engine,system or platform, such as a data warehouse or other data processingcluster (e.g., other types of database systems, including relational andnon-relational database systems), in some embodiments. The query may bespecified in according to various formats, languages (e.g., StructuredQuery Language (SQL), protocols, or interfaces (e.g., query statementsor predicates included in Application Programming Interface (API)message or request), in some embodiments. In order to perform the query,a query plan may be generated according to various query planoptimization techniques. For example, the operations to perform thequery plan may be identified and arranged in various orders (e.g.,different join orders). Each of the plans may then have a cost or valueassigned to the plan so that the plan with the lowest cost may beselected in order to provide the best performance for the query.

As indicated at 710, code to execute a plan may be generated by thequery engine that received the query, in various embodiments. Forexample, a plan may be organized according to a tree or other structurethat indicates relationships between operations in the plan. The planmay be a logical plan, in some embodiments, which may be mapped tooperations in a physical query plan. For example, operations such asoperations to find data (e.g., scan data), evaluate data (e.g., comparevalues with predicates, operators, or other data feature evaluations),transform data (e.g., aggregations, filtering, insertions, deletions,etc.), or move or manipulate data (e.g., join operations) may betransformed into code by a library or other mapping information thattranslates an identified operation into one or more functions,procedures, statements, classes, or other portions of code to performthe operations.

As indicated at 720, a determination may be made as to whether compiledportion(s) of the code are stored at the query engine, in someembodiments. For example, a manifest, index, or lookup table forcompiled code portions that corresponds to the different portions ofgenerated code may be maintained, which may be scanned, compared, orevaluated. As discussed below with regard to FIG. 8 , a uniqueidentifier may be generated and used as a lookup value based on thecontent of the generated code or other features, such as versionidentifier for the query engine. If code portions are locally stored,then the compiled portion(s) of the code may be obtained, as indicatedat 722, in some embodiments. For example, an identifier, file path, orother feature that points to the location of the compiled code may beidentified when determining whether compiled portions of the code arestored at the query engine.

As indicated at 730, a determination may be made as to whether compiledportion(s) of the code generated from a plan to perform a prior queryreceived at another query engine stored separate from the query engine,in some embodiments. The separate store, as discussed above with regardto FIGS. 1 and 4-6 may be a separate storage system (e.g., a databasesystem or file system) which may be stored in a remote computing devicesaccessed by the query engine via network requests, in some embodiments.For example, as discussed below with regard to FIG. 8 , to check whethera compiled portion exists, a request to perform a lookup formattedaccording to the storage system that includes a lookup key generatedfrom the content of the code may be sent. In some embodiments, cached orlocal manifest of the contents of the separate store may be maintainedat the query engine and evaluated locally (instead of sending a requestto the separate store so that requests are only sent for compiledobjects that are present), in some embodiments. The compiled portionsmay be generated from a query received prior to the query beingperformed and received at a different query engine, in some embodiments.

As indicated at 732, if compiled portion(s) are stored separate, thenthe compiled portion(s) stored separately may be obtained, in someembodiments. For example, a request to access, read, retrieve, orotherwise get the compiled portions may be sent to a storage system forthe compiled portions stored separately. In some embodiments, thecompiled portions may be encrypted, compressed, or otherwise encoded sothat the received compiled portions may be decoded when received. Thecompiled portion(s) may then be stored at the first query engine (e.g.,in local compiled code storage 452) for subsequent use. In someembodiments, more than the compiled portion(s) of the code may beobtained. For example, a set of compiled code objects which may be usedin for code in multiple queries may be obtained (even if it is not usedin the instant query).

For portions of the generated code that are not separately stored, theportions may be compiled as indicated at 740, in some embodiments. Acompiler corresponding to the type of language and/or features used toimplement the code may accept the code portions as input and generateexecutable objects that are compiled versions of the portion(s) of thecode. As indicated at 750, the compiled portion(s) of the code may bestored for subsequent queries, in some embodiments. For example, asdiscussed above with regard to FIGS. 4 and 6 , different techniques forupdating the separately stored compiled code may be implemented, such asstoring the code to a separate store, from which it may be obtained andcompiled, or storing the code compiled by the query engine directly tothe separate store. In some embodiments, criteria limiting code that maybe stored in the separate store may be applied, such as a size limitthat prevents code that is too large from being separately stored or asafety/security criteria that limits the types of operations included inthe code which can be compiled by the query engine for storage at theseparate store. In some embodiments, the location in which the compiledcode portion(s) are stored may be determined according to a size of thecompiled code portion(s). For example, compiled code objects larger thana threshold size may be stored in an object data store (which may nothave size limits for data objects) and compiled objects less than thethreshold size may be stored in a database or quick access caching store(which may have a size limit for data objects).

As indicated at 760, the compiled portion(s) may be executed whenexecuting the plan to perform the query, in some embodiments. Differentportions of code for the same query may be obtained from differentsources or compiled locally at the query engine. For example, oneportion may be obtained from the separate store, another portion fromthe store at the query engine, and another portion compiled by the queryengine (as well as various other combinations of obtaining compiledportions of the code), in various embodiments. In some embodiments, anentire query may be compiled and stored for reuse, locally and/or inseparate storage. In some embodiments, the query itself may be stored(or the query plan stored) for recompilation according to differentcompilation features (e.g., optimized compilation). To execute the planusing the compiled portions, various features of the query plan may beused as input parameters to the compiled code when executed.

FIG. 8 is a high-level flowchart illustrating methods and techniques toidentify the presence of compiled segments of code in a store forcompiled segments of code, according to some embodiments. As indicatedat 810, a segment of code to execute a plan to perform a query may beidentified, in some embodiments. For example, a query plan may begrouped into one (or multiple) operations (e.g., logical query planoperations may be isolated into physical query plan operation(s) thatcorrespond to the logical query plan operations). The code maycorrespond to the respective one or more operations which may, forinstance, access data, evaluate data, transform data, and/or store/movethe data, in various examples.

As indicated at 820, a unique identifier may be generated for thesegment of code, in some embodiments. In one example embodiment, arandom number may be generated to serve as the unique identifier. Inanother example embodiment, various hash functions or hashing schemesmay be applied to a text character string of the code (or to certainportions of the code) in order to generate a hash value. Uniqueidentifiers may incorporate different information. For instance, thegenerated hash value may be concatenated or otherwise added to a versionidentifier for the application implementing the query engine.

As indicated at 830, the unique identifier may be used as a lookup keyin a store for a compiled version of the segment of code, in someembodiments. For example, the store for compiled versions of code may bea key-value store (e.g., a non-relational database, object-based store,or relational database, or other data store that utilizes a key or otheridentifier to lookup an associated value), in some embodiments. Arequest may be formatted and sent to the store (e.g., an API request,SQL request, REST style request) that includes the hash value as thelookup key value that is applied to locate data that corresponds to thelookup key value.

As indicated at 840, a compiled segment may or may not be returned usingthe lookup key, in some embodiments. If, for instance, no compiledsegment is returned then a compiled version of the segment of code maybe determined as not exist (as a compiled segment of code would bestored at an entry in the store if such a segment of code were toexist). Then, as indicated at 842, the segment of code may be compiledto use for executing the plan, in some embodiments. If the compiledsegment is returned, then the returned compiled segment to execute theplan for performing the query, in some embodiments, as indicated at 850.For example, the response from the data store may include a data objectas the field, attribute, or other value of the entry corresponding tothe lookup key. The data object may be compressed and/or encrypted, andthus may be decompressed and/or decrypted, in some embodiments. Use ofthe returned compiled segment may insert or otherwise apply parametersfor the portion of the query that corresponds to the segment of code inorder to execute the complied segment when performing the query.

FIG. 9 is a high-level flowchart illustrating methods and techniques towarm a store for compiled code for executing queries, according to someembodiments. As indicated at 910, a warming event for a store ofcompiled code for performing queries may be detected, in someembodiments. A warming event may be an event for a new store of compiledcode (e.g., a new cache of compiled code created in a new storagestructure, such as a new table illustrated in FIG. 6 above), in someembodiments. In such embodiments, the new store may be created as aresult of a change in compiler, query engine, or other feature ofperforming queries that may use an updated compilation in order to usethe compiled code segments to execute queries. For example, a queryengine update to install a new version of the query engine may trigger awarming event.

As indicated at 920, code segments compiled and stored in an existingstore of compiled code for performing queries may be identified, in someembodiments. For example, an index, manifest, list, or other metadatamaintained for the contents of an existing store of compiled code may bescanned to identify distinct items. As indicated at 930, information tocompile the identified code segments may be obtained, in someembodiments. For example, compiled code objects in the existing storemay include a source identifier for the code used to generate the codeobjects in another data store (e.g., another data storage service),which may be used to locate corresponding code segments in a data store.In some embodiments, the code segments may be recreated from a storedquery plan or query that would include the code segments in order to becompiled.

As indicated at 940, the identified code segments may be compiled, insome embodiments. For example, the data store that stores the codesegments may be read at the identified locations, and then eachidentified code segment may be compiled. The compilation may account forthe changes that triggered the warming event, in some embodiments. Forexample, an update to a query engine may include an update to thecompiler to account for the change in the query engine. In someembodiments, the compilation may utilize a different set of compilerfeatures or settings, such as an optimized compilation setting that mayincrease compilation time but achieve a more performant executableobject for the compiled code segments.

As indicated at 950, the compiled code segments may be stored in thestore for compiled code segments, in some embodiments. For example, anew table or other data structure that stores the compiled code segmentsmay be created and then updated with the compiled code segments asdifferent items or objects in the new table.

The methods described herein may in various embodiments be implementedby any combination of hardware and software. For example, in oneembodiment, the methods may be implemented by a computer system (e.g., acomputer system as in FIG. 10 ) that includes one or more processorsexecuting program instructions stored on a computer-readable storagemedium coupled to the processors. The program instructions may implementthe functionality described herein (e.g., the functionality of variousservers and other components that implement the network-based virtualcomputing resource provider described herein). The various methods asillustrated in the figures and described herein represent exampleembodiments of methods. The order of any method may be changed, andvarious elements may be added, reordered, combined, omitted, modified,etc.

Embodiments of sharing compiled code to execute queries across queryengines as described herein may be executed on one or more computersystems, which may interact with various other devices. One suchcomputer system is illustrated by FIG. 10 . In different embodiments,computer system 1000 may be any of various types of devices, including,but not limited to, a personal computer system, desktop computer,laptop, notebook, or netbook computer, mainframe computer system,handheld computer, workstation, network computer, a camera, a set topbox, a mobile device, a consumer device, video game console, handheldvideo game device, application server, storage device, a peripheraldevice such as a switch, modem, router, or in general any type ofcomputing node, compute node, computing device, compute device, orelectronic device.

In the illustrated embodiment, computer system 1000 includes one or moreprocessors 1010 coupled to a system memory 1020 via an input/output(I/O) interface 1030. Computer system 1000 further includes a networkinterface 1040 coupled to I/O interface 1030, and one or moreinput/output devices 1050, such as cursor control device 1060, keyboard1070, and display(s) 1080. Display(s) 1080 may include standard computermonitor(s) and/or other display systems, technologies or devices. In atleast some implementations, the input/output devices 1050 may alsoinclude a touch- or multi-touch enabled device such as a pad or tabletvia which a user enters input via a stylus-type device and/or one ormore digits. In some embodiments, it is contemplated that embodimentsmay be implemented using a single instance of computer system 1000,while in other embodiments multiple such systems, or multiple nodesmaking up computer system 1000, may host different portions or instancesof embodiments. For example, in one embodiment some elements may beimplemented via one or more nodes of computer system 1000 that aredistinct from those nodes implementing other elements.

In various embodiments, computer system 1000 may be a uniprocessorsystem including one processor 1010, or a multiprocessor systemincluding several processors 1010 (e.g., two, four, eight, or anothersuitable number). Processors 1010 may be any suitable processor capableof executing instructions. For example, in various embodiments,processors 1010 may be general-purpose or embedded processorsimplementing any of a variety of instruction set architectures (ISAs),such as the x86, PowerPC, SPARC, or MIPS ISAs, or any other suitableISA. In multiprocessor systems, each of processors 1010 may commonly,but not necessarily, implement the same ISA.

In some embodiments, at least one processor 1010 may be a graphicsprocessing unit. A graphics processing unit or GPU may be considered adedicated graphics-rendering device for a personal computer,workstation, game console or other computing or electronic device.Modern GPUs may be very efficient at manipulating and displayingcomputer graphics, and their highly parallel structure may make themmore effective than typical CPUs for a range of complex graphicalalgorithms. For example, a graphics processor may implement a number ofgraphics primitive operations in a way that makes executing them muchfaster than drawing directly to the screen with a host centralprocessing unit (CPU). In various embodiments, graphics rendering may,at least in part, be implemented by program instructions that execute onone of, or parallel execution on two or more of, such GPUs. The GPU(s)may implement one or more application programmer interfaces (APIs) thatpermit programmers to invoke the functionality of the GPU(s). SuitableGPUs may be commercially available from vendors such as NVIDIACorporation, ATI Technologies (AMD), and others.

System memory 1020 may store program instructions and/or data accessibleby processor 1010. In various embodiments, system memory 1020 may beimplemented using any suitable memory technology, such as static randomaccess memory (SRAM), synchronous dynamic RAM (SDRAM),nonvolatile/Flash-type memory, or any other type of memory. In theillustrated embodiment, program instructions and data implementingdesired functions, such as those described above are shown stored withinsystem memory 1020 as program instructions 1025 and data storage 1035,respectively. In other embodiments, program instructions and/or data maybe received, sent or stored upon different types of computer-accessiblemedia or on similar media separate from system memory 1020 or computersystem 1000. Generally speaking, a non-transitory, computer-readablestorage medium may include storage media or memory media such asmagnetic or optical media, e.g., disk or CD/DVD-ROM coupled to computersystem 1000 via I/O interface 1030. Program instructions and data storedvia a computer-readable medium may be transmitted by transmission mediaor signals such as electrical, electromagnetic, or digital signals,which may be conveyed via a communication medium such as a networkand/or a wireless link, such as may be implemented via network interface1040.

In one embodiment, I/O interface 1030 may coordinate I/O traffic betweenprocessor 1010, system memory 1020, and any peripheral devices in thedevice, including network interface 1040 or other peripheral interfaces,such as input/output devices 1050. In some embodiments, I/O interface1030 may perform any necessary protocol, timing or other datatransformations to convert data signals from one component (e.g., systemmemory 1020) into a format suitable for use by another component (e.g.,processor 1010). In some embodiments, I/O interface 1030 may includesupport for devices attached through various types of peripheral buses,such as a variant of the Peripheral Component Interconnect (PCI) busstandard or the Universal Serial Bus (USB) standard, for example. Insome embodiments, the function of I/O interface 1030 may be split intotwo or more separate components, such as a north bridge and a southbridge, for example. In addition, in some embodiments some or all of thefunctionality of I/O interface 1030, such as an interface to systemmemory 1020, may be incorporated directly into processor 1010.

Network interface 1040 may allow data to be exchanged between computersystem 1000 and other devices attached to a network, such as othercomputer systems, or between nodes of computer system 1000. In variousembodiments, network interface 1040 may support communication via wiredor wireless general data networks, such as any suitable type of Ethernetnetwork, for example; via telecommunications/telephony networks such asanalog voice networks or digital fiber communications networks; viastorage area networks such as Fibre Channel SANs, or via any othersuitable type of network and/or protocol.

Input/output devices 1050 may, in some embodiments, include one or moredisplay terminals, keyboards, keypads, touchpads, scanning devices,voice or optical recognition devices, or any other devices suitable forentering or retrieving data by one or more computer system 1000.Multiple input/output devices 1050 may be present in computer system1000 or may be distributed on various nodes of computer system 1000. Insome embodiments, similar input/output devices may be separate fromcomputer system 1000 and may interact with one or more nodes of computersystem 1000 through a wired or wireless connection, such as over networkinterface 1040.

As shown in FIG. 10 , memory 1020 may include program instructions 1025,that implement the various methods and techniques as described herein,and data storage 1035, comprising various data accessible by programinstructions 1025. In one embodiment, program instructions 1025 mayinclude software elements of embodiments as described herein and asillustrated in the Figures. Data storage 1035 may include data that maybe used in embodiments. In other embodiments, other or differentsoftware elements and data may be included.

Those skilled in the art will appreciate that computer system 1000 ismerely illustrative and is not intended to limit the scope of thetechniques as described herein. In particular, the computer system anddevices may include any combination of hardware or software that canperform the indicated functions, including a computer, personal computersystem, desktop computer, laptop, notebook, or netbook computer,mainframe computer system, handheld computer, workstation, networkcomputer, a camera, a set top box, a mobile device, network device,internet appliance, PDA, wireless phones, pagers, a consumer device,video game console, handheld video game device, application server,storage device, a peripheral device such as a switch, modem, router, orin general any type of computing or electronic device. Computer system1000 may also be connected to other devices that are not illustrated, orinstead may operate as a stand-alone system. In addition, thefunctionality provided by the illustrated components may in someembodiments be combined in fewer components or distributed in additionalcomponents. Similarly, in some embodiments, the functionality of some ofthe illustrated components may not be provided and/or other additionalfunctionality may be available.

Those skilled in the art will also appreciate that, while various itemsare illustrated as being stored in memory or on storage while beingused, these items or portions of them may be transferred between memoryand other storage devices for purposes of memory management and dataintegrity. Alternatively, in other embodiments some or all of thesoftware components may execute in memory on another device andcommunicate with the illustrated computer system via inter-computercommunication. Some or all of the system components or data structuresmay also be stored (e.g., as instructions or structured data) on acomputer-accessible medium or a portable article to be read by anappropriate drive, various examples of which are described above. Insome embodiments, instructions stored on a non-transitory,computer-accessible medium separate from computer system 1000 may betransmitted to computer system 1000 via transmission media or signalssuch as electrical, electromagnetic, or digital signals, conveyed via acommunication medium such as a network and/or a wireless link. Variousembodiments may further include receiving, sending or storinginstructions and/or data implemented in accordance with the foregoingdescription upon a computer-accessible medium. Accordingly, the presentinvention may be practiced with other computer system configurations.

It is noted that any of the distributed system embodiments describedherein, or any of their components, may be implemented as one or moreweb services. In some embodiments, a network-based service may beimplemented by a software and/or hardware system designed to supportinteroperable machine-to-machine interaction over a network. Anetwork-based service may have an interface described in amachine-processable format, such as the Web Services DescriptionLanguage (WSDL). Other systems may interact with the web service in amanner prescribed by the description of the network-based service'sinterface. For example, the network-based service may define variousoperations that other systems may invoke, and may define a particularapplication programming interface (API) to which other systems may beexpected to conform when requesting the various operations.

In various embodiments, a network-based service may be requested orinvoked through the use of a message that includes parameters and/ordata associated with the network-based services request. Such a messagemay be formatted according to a particular markup language such asExtensible Markup Language (XML), and/or may be encapsulated using aprotocol such as Simple Object Access Protocol (SOAP). To perform a webservices request, a network-based services client may assemble a messageincluding the request and convey the message to an addressable endpoint(e.g., a Uniform Resource Locator (URL)) corresponding to the webservice, using an Internet-based application layer transfer protocolsuch as Hypertext Transfer Protocol (HTTP).

In some embodiments, web services may be implemented usingRepresentational State Transfer (“RESTful”) techniques rather thanmessage-based techniques. For example, a web service implementedaccording to a RESTful technique may be invoked through parametersincluded within an HTTP method such as PUT, GET, or DELETE, rather thanencapsulated within a SOAP message.

The various methods as illustrated in the FIGS. and described hereinrepresent example embodiments of methods. The methods may be implementedin software, hardware, or a combination thereof. The order of method maybe changed, and various elements may be added, reordered, combined,omitted, modified, etc.

Various modifications and changes may be made as would be obvious to aperson skilled in the art having the benefit of this disclosure. It isintended that the invention embrace all such modifications and changesand, accordingly, the above description to be regarded in anillustrative rather than a restrictive sense.

1-20. (canceled)
 21. A system, comprising: one or more processors; and amemory, that stores program instructions that, when executed by the atleast one processor, cause the one or more processors to implement adatabase service, configured to: detect a warming event forpre-populating a local cache for a query engine; identify storedportions of code received from a plurality of query engines hosted bythe database service for respective queries performed by the pluralityof query engines to different respective databases of the databaseservice; compile the stored portions of code; and provide compiledversions of one or more of the stored portions of code to store in thelocal cache for the query engine to perform one or more subsequentqueries that the query engine is likely to receive.
 22. The system ofclaim 21, wherein the warming event is detection of a different compilerused to compile code generated for performing queries at the databaseservice and wherein the compilation of the stored portions of the codeis performed using the different compiler.
 23. The system of claim 21,wherein the warming event is detection of a different version of thequery engine and wherein the compilation of the stored portions of thecode is performed based on the different version of the query engine.24. The system of claim 21, wherein the stored portions of code areidentified according to source identifiers maintained for previouslycompiled versions of the stored portions of the code and wherein thesource identifiers are usable to locate the stored portions of code. 25.The system of claim 21, wherein the database service is furtherconfigured to obtain respective query plans for the respective queriesand wherein the compilation of the stored portions of the code isperformed using the respective query plans.
 26. The system of claim 21,wherein the database service is further configured to store the compiledversions of the stored portions of code in a global compiled code store.27. The system of claim 26, wherein the database service is furtherconfigured to delete one of the compiled versions from the globalcompiled code store according to a time-to-live value for the onecompiled version.
 28. A method, comprising: detecting, at a databaseservice, a warming event for pre-populating a local cache for a queryengine; identifying, by the database service, stored portions of codereceived from a plurality of query engines hosted by the databaseservice for respective queries performed by the plurality of queryengines to different respective databases of the database service;compiling, by the database service, the stored portions of code; andproviding, by the database service, compiled versions of one or more ofthe stored portions of code to store in the local cache for the queryengine to perform one or more subsequent queries that the query engineis likely to receive.
 29. The method of claim 28, wherein the warmingevent is detection of a different compiler used to compile codegenerated for performing queries at the database service and wherein thecompilation of the stored portions of the code is performed using thedifferent compiler
 30. The method of claim 28, wherein the warming eventis detection of a different version of the query engine and wherein thecompilation of the stored portions of the code is performed based on thedifferent version of the query engine.
 31. The method of claim 28,wherein the stored portions of code are identified according to sourceidentifiers maintained for previously compiled versions of the storedportions of the code and wherein the source identifiers are usable tolocate the stored portions of code.
 32. The method of claim 28, whereinthe database service is further configured to obtain respective queryplans for the respective queries and wherein the compilation of thestored portions of the code is performed using the respective queryplans.
 33. The method of claim 28, further comprising storing thecompiled versions of the stored portions of code in a global compiledcode store.
 34. The method of claim 33, further comprising deleting oneof the compiled versions from the global compiled code store accordingto a time-to-live value for the one compiled version
 35. One or morenon-transitory computer-readable storage media storing programinstructions that, when executed on or across one or more computingdevices, cause the one or more computing devices to implement a databaseservice, that implements: detecting a warming event for pre-populating alocal cache for a query engine; identifying stored portions of codereceived from a plurality of query engines hosted by the databaseservice for respective queries performed by the plurality of queryengines to different respective databases of the database service;compiling the stored portions of code; and providing compiled versionsof one or more of the stored portions of code to store in the localcache for the query engine to perform one or more subsequent queriesthat the query engine is likely to receive.
 36. The one or morenon-transitory computer-readable storage media of claim 35, wherein thewarming event is detection of a different compiler used to compile codegenerated for performing queries at the database service and wherein thecompilation of the stored portions of the code is performed using thedifferent compiler.
 37. The one or more non-transitory computer-readablestorage media of claim 35, wherein the warming event is detection of adifferent version of the query engine and wherein the compilation of thestored portions of the code is performed based on the different versionof the query engine.
 38. The one or more non-transitorycomputer-readable storage media of claim 35, wherein the stored portionsof code are identified according to source identifiers maintained forpreviously compiled versions of the stored portions of the code andwherein the source identifiers are usable to locate the stored portionsof code.
 39. The one or more non-transitory computer-readable storagemedia of claim 35, wherein the database service is further configured toobtain respective query plans for the respective queries and wherein thecompilation of the stored portions of the code is performed using therespective query plans.
 40. The one or more non-transitorycomputer-readable storage media of claim 35, storing further programinstructions that when executed on or across the one or more computingdevices, cause the database service to further implement storing thecompiled versions of the stored portions of code in a global compiledcode store.